package com.ruoyi.service.impl;

import com.ruoyi.service.AlyService;
import com.ruoyi.utils.ALYMessageUtils;
import com.ruoyi.utils.SimpleResult;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.util.Map;

@Service
public class AlyServiceImpl implements AlyService {
    @Override
    public boolean sendCode(String phoneNumber) {
        String code = ALYMessageUtils.getCode(6);
        String resultCode = ALYMessageUtils.sendCodeMessage(phoneNumber, code, "广州宇格水淼科技", "SMS_465650165");
        Map<String, String> resultMap = ALYMessageUtils.parseResult(resultCode);
        if (resultMap.get("code").equals("200")) {
            return true;
        } else {
            return false;
        }
    }
}
